{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set menu = 'admin_coin_model' %}

{% set script_controller = "coin/save" %}
{% block main %}
  {{ web_macro.flash_messages() }}
  <form class="form-horizontal" method="post" id="coin-model-form" action="{{path('admin_coin_model_save')}}">
  
    <ul class="breadcrumb">
      <li><a href="{{path('admin_coin_model')}}">使用方式设置</a></li>
      <li class="active">课程价格设置</li>
    </ul>

    <p>
      <span>使用方式：</span>
      <strong class="text-info">{% if set.cash_model =="deduction" %}用于抵扣{% else %}用于标价{% endif %}</strong>
      <span class="mll" data-val="{{ set.cash_rate}}" id="cash-rate">汇率：</span>
      1元人民币兑换 <strong class="text-info">{{ set.cash_rate}}</strong> {{ setting('coin.coin_name') }}
      {% if set.cash_model =="deduction" %}{% else %}<a class="btn btn-info btn-sm set mlm"><span class="glyphicon glyphicon-repeat"></span> 按汇率批量设置价格</a>{% endif %}
    </p>
    <div id="typelist">
      {% include 'TopxiaAdminBundle:Coin:coin-table-setting.html.twig' %}
    </div>
    <input type="hidden" name="cash_model" value="{{ set.cash_model }}">
    <input type="hidden" name="cash_rate" value="{{ set.cash_rate }}">
    <input type="hidden" name="type" value="{{type|default('course')}}">
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
    <p>
      <button type="submit" class="btn btn-primary pull-right" id="finish" >完成</button>
      <a type="button" href="{{ url('admin_coin_model',{set:set}) }}" class="btn btn-link pull-right">上一步</a>
    </p>
  </form>
{% endblock %}